package org.middleware.dao.system;

import org.middleware.entity.system.SysDepartments;
import org.middleware.mapper.system.SysDepartmentsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SysDepartmentsDao {

    @Autowired
    private SysDepartmentsMapper departmentsMapper;

    public List<SysDepartments> getDepartmentByEnterpriseId(int id){
        return departmentsMapper.getDepartmentByEnterpriseId(id);
    }

    public int create(SysDepartments department) {
        return departmentsMapper.create(department);
    }

    public int update(SysDepartments department) {
        return departmentsMapper.update(department);
    }

    public int delete(int id) {
        return departmentsMapper.delete(id);
    }

    public int deleteDepartmentWithChildren(List<Integer> list) {
        return departmentsMapper.deleteDepartmentWithChildren(list);
    }
}
